#include "LayerFactory.h"
#include "PhysicalLayer.h"
#include "DataLinkLayer.h"
#include "NetworkLayer.h"
#include "TransportLayer.h"
#include "SessionLayer.h"
#include "PresentationLayer.h"
#include "ApplicationLayer.h"

ILayer* CLayerFactory::CreateLayer( const std::string& name )
{
	ILayer * layer = NULL;

	do 
	{
		if(name.compare("PHYSICAL") == 0) {
			layer = new CPhysicalLayer();
			break;
		}

		if(name.compare("DATALINK") == 0) {
			layer = new CDataLinkLayer();
			break;
		}

		if(name.compare("NETWORK") == 0) {
			layer = new CNetworkLayer();
			break;
		}

		if(name.compare("TRANSPORT")== 0) {
			layer = new CTransportLayer();
			break;
		}

		if(name.compare("SESSION")== 0) {
			layer = new CSessionLayer();
			break;
		}

		if(name.compare("PRESENTATION")== 0) {
			layer = new CPresentationLayer();
			break;
		}

		if(name.compare("APPLICATION")== 0) {
			layer = new CApplicationLayer();
			break;
		}

	} while (0);

	return layer;

}
